import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { registerMicroApps, start } from 'qiankun';
import './public-path';
ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);
registerMicroApps(
  [
    {
      name: 'qiankun-react-starter',
      entry: 'http://localhost:3001',
      container: '#container',
      activeRule: '/qiankun-react-starter',
    },
    {
      name: 'qiankun-vue-starter',
      entry: 'http://localhost:8080',
      container: '#container',
      activeRule: '/qiankun-vue-starter',
    },
  ],
  {
    // eslint-disable-next-line no-console
    beforeLoad: app => console.log('before load', app.name),
    // eslint-disable-next-line no-console
    beforeMount: [app => console.log('before mount', app.name)],
  }
);
// 启动 qiankun
start();
